home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-21 / dvxtec.zip / PORT2DOS.TEC < prev    next >
Text File  |  1992-03-31  |  9KB  |  292 lines

  1. ID:PD Porting UNIX X Clients to DOS under DESQview/X
  2. Quarterdeck Technical Note #405
  3. by Kris Williams & Mark Welinder
  4.                                
  5.              Porting Unix X clients to DOS under DESQview/X
  6.  
  7. The X Window System Toolkit offers the software developer the ability to
  8. write an X specific application's code once, then compile it for each X
  9. Window System platform they want it to run on.  These programs are
  10. refered to as X Clients.  X Clients are dependent on the presence of the
  11. X Window System, which means they won't run without it's resources being
  12. available.
  13.  
  14. This document covers:
  15.  
  16.    ■  Components of Quarterdeck's X11R4 Development toolkit,
  17.    ■  Compiler and DOS Extender compatibility,
  18.    ■  Overview of Quarterdeck's QMAKE utility,
  19.    ■  Unix system-call considerations,
  20.    ■  32-bit to 16-bit porting considerations,
  21.    ■  and Porting Unix C X Clients to DOS Real Mode using Microsoft C.
  22.  
  23.  
  24.                       DESQview/X Toolkit Contents
  25.  
  26. There are a few different packages available for porting/development X
  27. client applications to/on DOS for use with DESQview/X.  Many of these
  28. packages are included with Quarterdeck's standard X Toolkit, and some of
  29. them are available from companies other that Quarterdeck.  The sections
  30. to follow will introduce each of these packages.
  31.  
  32.                Quarterdeck's X11R4 Development Toolkit
  33.  
  34. This is the base X11R4 developement package, which has all of the
  35. example source, and linkable libraries which are needed to build Xt and
  36. XLib X Clients.  This X development package is directly available from
  37. Quarterdeck.
  38.  
  39.             Quarterdeck's Motif Toolkit (OSF/Motif 1.1.1)
  40.  
  41. This development module contains the preprocessor files, linkable
  42. library files, and sample source code for the OSF/Motif 1.1 Widget X
  43. Toolkit.  This package is directly available from Quarterdeck.
  44.  
  45.                                 Xview
  46.  
  47. (X Window-System Visual/Integrated Environment for Workstations).  a
  48. user-interface toolkit which was developed by Sun Microsystems, for the
  49. SunView windowing system, and ported to DOS for use with DESQview/X and
  50. the OPENLOOK window manager.  This package is also directly available
  51. from Quarterdeck Office Systems.
  52.  
  53.                                  XVT
  54.  
  55. XVT is an X toolkit package, developed by XVT, Inc., to provide a GUI
  56. programmer with the ability to write a single program, and the code will
  57. be portable to other graphical platforms.  This package is available
  58. from only XVT, Inc.
  59.  
  60.  
  61.                          Supported Compilers
  62.  
  63. MetaWare High C
  64.  
  65. This compiler produces 386 protected mode, DOS extended, 32-bit X
  66. clients. The versions 1.71 and 2.3 are compatible with the X11R4
  67. Toolkit.  Use of this compiler may be necessary for extremely large X
  68. client applications. This compiler is available from Metaware, Inc.
  69.  
  70. Microsoft C
  71.  
  72. This compiler produces Real Mode or 286 DOS extended, 16-bit X clients.
  73. Versions 5.1 and 6.0 are compatible with the X11R4 Toolkit.  Version 6.0
  74. is required to take advantage of Dynamic Link Libraries (DLL's) created
  75. with Rational System's DOS4GX.
  76.  
  77. Zortech C++ 3.0
  78.  
  79. This compiler produces Real Mode, 286 protected mode DOS extended
  80. 16-bit, or 386 Dos extended 32-bit X clients.  Version 3.0 is required
  81. to be compatible with the X11R4 Toolkit.  Zortech C++ 3.0 is available
  82. from Zortech, Inc.
  83.  
  84. Watcom C
  85.  
  86. This compiler will be supported by first release, and will be available
  87. from Watcom, Inc.
  88.  
  89.  
  90.                          Supported DOS Extenders
  91.  
  92. Rational Systems' DOS16M & DOS4GX
  93.  
  94.  
  95. PharLap's 386|DOS-Extender SDK
  96.  
  97.  
  98. Ergo 386 DOS Extender
  99.  
  100.  
  101.                            Supported Debuggers
  102.  
  103. Rational Systems' Instant D
  104.  
  105. 16 Bit
  106. 32 Bit
  107. Comes with extender
  108.  
  109. MetaWare Debugger
  110.  
  111. 32 Bit
  112. Use with Phar Lap Extender
  113. Comes with HC386
  114.  
  115.  
  116.                                  Program Models
  117.  
  118. Real Mode
  119.    Microsoft C
  120.  
  121. 286 Protected Mode
  122.    MSC + DOS16M
  123.    MSC + DOS4GX
  124.  
  125. 386 Protected Mode
  126.    HC386 + DOS4GX
  127.    HC386 + Phar Lap
  128.       EXP executable
  129.    DOS4GX Formats
  130.  
  131. 16 Bit Protected Mode
  132.    Shared Code
  133.    No Shared Libraries
  134.    SegExe executable
  135.  
  136. 16 Bit protected mode
  137.    Shared Code
  138.    Shared libraries
  139.    DLL's in standard format
  140.    LinExe executable format
  141.  
  142. 32 Bit protected mode
  143.    Shared code
  144.    Shared libraries
  145.    DLL's in standard format
  146.  
  147.  
  148.                                  Porting Tools
  149.  
  150. X11 Toolkit
  151.    End user DESQview/X
  152.    Xlib
  153.    Xt
  154.    Xaw
  155.    Sample clients and demos
  156.  
  157. Motif Toolkit
  158.    X11 Toolkit
  159.    Xm
  160.    Mrm
  161.    Uil
  162.    Motif Window Manager
  163.    Sample clients and demos
  164.    Utility Programs
  165.  
  166.  
  167.                                     QMAKE
  168.  
  169. QMAKE is Quarterdeck's Unix style make facility takes environment for
  170. command line parameters.
  171. Use with included makefiles.
  172. Supports macros,
  173. include files,
  174. multiple targets etc.
  175. Sample makefiles are model specific: MSCREAL, HCPHAR, HC4GX etc.
  176. application.
  177.  
  178.                            GETPROTO and SORTFNDF
  179.  
  180. Xset,
  181. Xsetroot,
  182. Xev,
  183. Xwd,
  184. Xwud etc.
  185.  
  186. Porting Perspective and Methodology
  187.  
  188. DOS filenames are limited to 11 characters (ie 12345678.901).
  189. Unix "/" characters must be replaced with DOS "\" characters.
  190. All Unix system calls need to accounted for, eg fork().
  191. Check source for system specific (platform dependant) calls.
  192. Varying behaviour of compilers, eg variable argument lists.
  193. DOS applications must support the little endian byte order.
  194. Unless you are porting from a Digital Equipment machine based on a VAX
  195. or a MIPS chipset or from the varieties of Unix ported for the Intel
  196. 80x86, you will have to address this problem at the source level within
  197. your application.
  198. Differing system resources.
  199. Type conversions - signed/unsigned.
  200.  
  201. Porting Overview
  202.  
  203. Determine if 16 bit or 32 bit application
  204. Different integer size (286 integer is 16 bits and 386 integer is 32 bits)
  205. All code ported to 16 bits should be prototyped.
  206. Use Quarterdeck method with real mode compiler.
  207. Use R4 prototypes with protected mode compiler.
  208.  
  209. Porting Process
  210.  
  211. Before copying files to DOS, check length of name.
  212. Make small changes in source: add or change system calls if necessary
  213. and add or change include files if necessary.
  214. Compile and link to the X libraries.
  215. DOS extend if necessary.
  216.  
  217. Potential bugs
  218.  
  219. Ensure that the correct header files get included: XT - Intrinsicl.h,
  220. Intrinsic.h, IntrinsicP.h
  221. Some functions are also defined as macros.
  222. Beware of integer size conversions.
  223.  
  224. Porting Tips
  225.  
  226. Eliminate compiler warning messages (especially for 16 Bit
  227. applications). Use XSync, particularly useful at toolkit level. Test on
  228. as many servers as possible. For extreme bugs, debug remotely. Write
  229. private error handlers. Work through a sample port.
  230.  
  231. QMAKE
  232.  
  233. Quarterdeck's Unix style make facility takes environment for command
  234. line parameters. Use with included makefiles. Support  macros, include
  235. files, multiple targets etc. Sample makefiles are model specific:
  236. MSCREAL, HCPHAR, HC4GX etc.
  237.  
  238.   GETPROTO and SORTFNDF
  239.   For prototyping 16 bit code
  240.  
  241.    Xset, Xsetroot, Xev, Xwd, Xwud etc.
  242.  
  243.  
  244. Porting Perspective and Methodology
  245.  
  246. DOS filenames are limited to 11 characters (ie 12345678.901). Unix "/"
  247. characters must be replaced with DOS "\" characters. All Unix system
  248. calls need to accounted for, eg fork(). Check source for system specific
  249. (platform dependant) calls.
  250.  
  251. Varying behaviour of compilers, e.g. variable argument lists.
  252.  
  253. DOS applications must support the little endian byte order. Unless you
  254. are porting from a Digital Equipment machine based on a VAX or a MIPS
  255. chipset or from the varieties of Unix ported for the Intel 80x86, you
  256. will have to address this problem at the source level within your
  257. application.
  258.  
  259. Differing system resources.
  260.  
  261. Type conversions - signed/unsigned.
  262.  
  263. Porting Overview
  264.  
  265. Determine if 16 bit or 32 bit application. Different integer size (286
  266. integer is 16 bits and 386 integer is 32 bits).
  267.  
  268. All code ported to 16 Bits should be prototyped.
  269. Use Quarterdeck method with real mode compiler.
  270. Use R4 prototypes with protected mode compiler.
  271.  
  272. Porting Process
  273.  
  274. Before copying files to DOS, check length of name. Make small changes in
  275. source: add or change system calls if necessary and add or change
  276. include files if necessary. Compile and link to the X libraries. DOS
  277. extend if necessary.
  278.  
  279. Potential bugs
  280.  
  281. Ensure that the correct header files get included: XT - Intrinsicl.h,
  282. Intrinsic.h, IntrinsicP.h Some functions are also defined as macros.
  283. Beware of integer size conversions.
  284.  
  285. Porting Tips
  286.  
  287. Eliminate compiler warning messages (especially for 16 bit
  288. applications). Use XSync, particularly useful at toolkit level. Test on
  289. as many servers as possible. For extreme bugs, debug remotely. Write
  290. private error handlers. Work through a sample port.
  291.  
  292.